package com.yu.bean;

import java.util.Date;

import javax.validation.constraints.Pattern;

public class Info {
    private Integer infoId;

    private Integer adId;
    
    private Integer cateId;
    @Pattern(regexp = "^[\\s\\S]{1,60}$", message="标题长度在1-60位之间")
    private String infoTitle;
    
    @Pattern(regexp = "^[\\S\\s]{1,20000}$", message="内容长度在1-20000之间")
    private String infoContent;

    private Date infoDate;

    private String infoAuthor;

    private Integer infoBnum;

    private Integer infoCnum;

    @Pattern(regexp = "^\\S*$", message="请输入来源！")
    private String infoOrigin;
    
    private Admin admin;    //封装Admin对象
    
    private Category category; //封装Category
    
    
    
    

    public Category getCategory() {
		return category;
	}


	public void setCategory(Category category) {
		this.category = category;
	}


	public Info() {
		super();
		// TODO Auto-generated constructor stub
	}
    /*只要生成有参构造器一定要生成无参构造器*/


	public Admin getAdmin() {
		return admin;
	}

	public Info(Integer infoId, Integer adId, String infoTitle, String infoContent, Integer cateId, Date infoDate,
			String infoAuthor, Integer infoBnum, Integer infoCnum, String infoOrigin) {
		super();
		this.infoId = infoId;
		this.adId = adId;
		this.infoTitle = infoTitle;
		this.infoContent = infoContent;
		this.cateId = cateId;
		this.infoDate = infoDate;
		this.infoAuthor = infoAuthor;
		this.infoBnum = infoBnum;
		this.infoCnum = infoCnum;
		this.infoOrigin = infoOrigin;
	}
	public void setAdmin(Admin admin) {
		this.admin = admin;
	}

	public Integer getInfoId() {
        return infoId;
    }

    public void setInfoId(Integer infoId) {
        this.infoId = infoId;
    }

    public Integer getAdId() {
        return adId;
    }

    public void setAdId(Integer adId) {
        this.adId = adId;
    }

    public String getInfoTitle() {
        return infoTitle;
    }

    public void setInfoTitle(String infoTitle) {
        this.infoTitle = infoTitle == null ? null : infoTitle.trim();
    }

    public String getInfoContent() {
        return infoContent;
    }

    public void setInfoContent(String infoContent) {
        this.infoContent = infoContent == null ? null : infoContent.trim();
    }

    public Integer getCateId() {
        return cateId;
    }

    public void setCateId(Integer cateId) {
        this.cateId = cateId;
    }

    public Date getInfoDate() {
        return infoDate;
    }

    public void setInfoDate(Date infoDate) {
        this.infoDate = infoDate;
    }

    public String getInfoAuthor() {
        return infoAuthor;
    }

    public void setInfoAuthor(String infoAuthor) {
        this.infoAuthor = infoAuthor == null ? null : infoAuthor.trim();
    }

    public Integer getInfoBnum() {
        return infoBnum;
    }

    public void setInfoBnum(Integer infoBnum) {
        this.infoBnum = infoBnum;
    }

    public Integer getInfoCnum() {
        return infoCnum;
    }

    public void setInfoCnum(Integer infoCnum) {
        this.infoCnum = infoCnum;
    }

    public String getInfoOrigin() {
        return infoOrigin;
    }

    public void setInfoOrigin(String infoOrigin) {
        this.infoOrigin = infoOrigin == null ? null : infoOrigin.trim();
    }
}